<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Signin
 *
 * @author peerawatj20
 */
class signin_model extends CI_Model {

    private $_table_admin = 'vpc_administrator';
    private $_table_lg_login = 'vpc_lg_login';

    public function check_username($user, $pwd) {
        $query = $this->db->get_where($this->_table_admin, array('username' => $user, 'password' => $pwd));
        return $query->result();
    }

    public function insert_log_login($user) {
        $this->db->insert($this->_table_lg_login, array('login_name' => $user
            , 'ip_address' => $this->input->ip_address()
            , 'created_date' => date("Y-m-d H:i:s")
            , 'created_by' => $user));
    }

}
